package test1;

import java.util.Random;

public class Test2 {
    public static void main(String[] args) {

        Random random = new Random();
        for (int i = 0; i < 10; i++) {
            int j = random.nextInt(5);
            System.out.println(j);
        }


        int[] arr={1,3,51,12,4,56,7,8,2,5};

        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(min>arr[i]){
                min = arr[i];
            }
        }

        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(max<arr[i]){
                max = arr[i];
            }

        }

        System.out.println("差值："+(max-min));


        System.out.println(Math.floor((Math.random()*100)+1));
    }
}
